#include <stdio.h>
#include <string.h>

bool checkOnesSegment(char* s) {
    int sz = (int)strlen(s);
    int c = 0;
    for (int i = 0; i < sz; i++)
    {
        if (s[i] == '1')
        {
            c++;
            while ( s[i] == '1')
            {
                i++;
            }
        }
    }
    if (c <= 1)
    {
        return true;
    }
    else
    {
        return false;
    }
}


int main() {

    char arr[] = "0011111000";
    bool ret = checkOnesSegment(arr);
    if (ret == 1)
        printf("true\n");
    else
        printf("false\n");
    return 0;
}